import inspect

def add(x: int, y: int=1, *args, **kwargs) -> int:
    return x + y

print(add.__annotations__)

sig = inspect.signature(add)
print(sig)

print("params:", sig.parameters)
print("return:", sig.return_annotation)

print(sig.parameters["x"])
print(sig.parameters["x"].annotation)
print(sig.parameters["y"].kind)

print(sig.parameters["args"])
print(sig.parameters["args"].annotation)

print(sig.parameters["kwargs"])
print(sig.parameters["kwargs"].annotation)

